package org.x.casemodule.mapper;

import org.apache.ibatis.annotations.Select;
import org.x.casemodule.entity.DocumentTemplateEntity;
import com.mybatisflex.core.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Optional;

/**
 * 文书模板表 映射层。
 *
 * @author mybatis-flex-helper automatic generation
 * @since 1.0
 */
@Mapper
public interface DocumentTemplateMapper extends BaseMapper<DocumentTemplateEntity> {

    @Select("SELECT * FROM document_template WHERE template_name = #{name}")
    Optional<DocumentTemplateEntity> findByName(String name);

    @Select("SELECT * FROM document_template WHERE is_active = 1")
    List<DocumentTemplateEntity> findAllActiveTemplates();


}
